<template>
  <div class="recommend">
    <HomeSwiper />
    <song-sheet-list :hot-song="hotSong" />
  </div>
</template>
<script>
import SongSheetList from "../components/main/recommend/SongSheetList";
import HomeSwiper from "../components/main/recommend/HomeSwiper.vue";
export default {
  data() {
    return {
      hotSong: [],
    };
  },
  methods: {
    async fetchHotSong() {
      const res = await this.$http.get("/recommend/playlist");
      console.log(res);
      this.hotSong = res.data.data.list.map((item) => ({
        id: item.id,
        img: item.cover_url_small,
        title: item.title,
        info: item.creator_info.nick,
      }));
      console.log(this.hotSong);
    },
  },
  created() {
    this.fetchHotSong();
  },
  components: {
    HomeSwiper,
    SongSheetList,
  },
};
</script>